﻿using System;
using System.Collections.Generic;

namespace MvcForum.Net.Bussiness
{
  public  class ActivityRepo
    {

      public static void Save(string sessionId,int userId,string username,string ip,string pageTitle,string location,int forumId,int topicId,string browser,string platform,bool isPrivated,int pastMin)
      {
          MainDB.Instant.Activity_Save(sessionId,userId,username,ip,pageTitle,location,forumId,topicId,browser,platform,isPrivated,pastMin).Execute();
      }


      public static List<Activity> List(string filter, string sortBy, string orderBy, int pageIndex, int pageSize, out int totalRows)
      {

          var _sp = MainDB.Instant.Activity_List(pageIndex, pageSize);
          var _data = _sp.ExecuteTypedList<Activity>();

          totalRows = Convert.ToInt32(_sp.OutputParameters.GetParameter("TotalRows").ParameterValue);

          return _data;

      }
    }
}
